Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Activation commands (source /path/to/activate) were being saved to bash history on each terminal open, bloating history and making reverse-i-search unusable.

Changes

  • Added shellsWithLeadingSpaceHistorySupport - Shells supporting HISTCONTROL=ignorespace (bash) or setopt HIST_IGNORE_SPACE (zsh): bash, zsh, gitbash
  • Modified getShellCommandAsString - Prepends space for supported shells
// Before: "source /path/to/venv/bin/activate"
// After:  " source /path/to/venv/bin/activate"

Shell investigation

Shell Leading space support
bash, zsh, gitbash ✅ Implemented
pwsh Requires custom AddToHistoryHandler - not default
fish, sh, ksh, csh, nu Not supported
Original prompt

This section details on the original issue you should resolve

<issue_title>Bash activation command without proceeding space bloating bash-history</issue_title>
<issue_description>The activation of the venv is performed by command source $venv_path without space at the start. This result in this command stored multiple time in bash-history, bloating and overwriting it. This quickly makes reverse-i-search unusable.

Please use source $venv_path instead.</issue_description>

<agent_instructions>Investigate if we can do the same for other shells as well. Shell specific </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix bash activation command to prevent history bloating Add leading space to shell activation commands to prevent history bloating Feb 2, 2026
Copilot AI requested a review from anthonykim1 February 2, 2026 16:13
@Tyriar Tyriar assigned Tyriar and unassigned anthonykim1 Feb 3, 2026
@Tyriar Tyriar added this to the February 2026 milestone Feb 3, 2026
@Tyriar Tyriar added the feature-request Request for new features or functionality label Feb 3, 2026
@Tyriar Tyriar marked this pull request as ready for review February 3, 2026 16:20
@Tyriar Tyriar enabled auto-merge (squash) February 3, 2026 16:46
@Tyriar Tyriar merged commit 1f7b7ef into main Feb 3, 2026
11 checks passed
@Tyriar Tyriar deleted the copilot/fix-bash-history-bloating branch February 3, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bash activation command without proceeding space bloating bash-history

4 participants